    use: 'ie.ondevice.objectkit.core';
    
    String.implement.preventOverride= true;
    String.implement
    (
        {
            /**
             * Trim leading and trailing whitespace from a string.
             * 
             * @example alert(' characters '.trim()); // 'characters'
             * @return {String}
             */
            trim: function () 
            {                    
                var	value = this.replace(/^\s\s*/, ''),
    				whitespacePattern = /\s/,
    				i = value.length;
    			while (whitespacePattern.test(value.charAt(--i)));
    			return value.slice(0, i + 1);
            }
            
            /**
             * Determine if a string is empty or not. A string qualifies as
             * empty if it has a length of 0 or consists only of whitespace.
             * 
             * @example alert(''.isEmpty()); // true
             * @example alert('   '.isEmpty()); // true
             * @example alert(new String().isEmpty()); // true
             * @example alert(' !'.isEmpty()); // false
             * 
             * @return {Boolean}
             * @see String.nonEmpty
             */
        ,   isEmpty: function () 
            {
                if (0 === this.length)
                    return true;
                    
                return 0 === this.trim().length;
            }
            
            /**
             * Prepend a string to the begining of this string, returning a
             * new string. The string on which the prepend method was called
             * is not modified.
             * 
             * @example alert('o'.prepend('hell')); // 'hello'
             * 
             * @param {String} value    A primitive or object string
             * @return {String}         A string object
             */
        ,   prepend: function (value) 
            {
                return String(value) + this;
            }
            
            /**
             * Append a string to the end of this string, returning a new string.
             * The string on which the append method was called is not
             * modified.
             * 
             * @example alert('hell'.append('o')); // 'hello'
             * 
             * @param {String} value    A primitive or object string
             * @return {String}         A string object
             */
        ,   append: function (value) 
            {
                return this + String(value);
            }
            
            /**
             * Determine if this string begins with the value of another.
             * 
             * @example alert ('hello'.beginsWith('hell')); // true
             * 
             * @param {String} value    Any value.
             * @return {Boolean}
             */
        ,   beginsWith: function (value) 
            {
                return String(value) == this.substr(0, value.length);
            }
            
            /**
             * Determine if this string ends with the value of another.
             * 
             * @example alert('hello'.endsWith('lo')); // true
             * 
             * @param {String} value    Any value.
             * @return {Boolean}
             */
        ,   endsWith: function (value) 
            {
                return String(value) == this.substr(this.length - value.length);
            }
        }
    );
    
    String.implementStatic
    (
        {
            
            /**
             * Determine if a value is a non-empty string. In order to qualify,
             * the value must be a string primitive or object of greater than 
             * zero length and containing at least one non-whitespace character.
             * 
             * @param {Object} value    Any value.
             * @return {Boolean}        Whether the value is a non-empty string
             */
            notEmpty: function (value) 
            {
                return String.is(value) && !(value.isEmpty());
            }
            
            /**
             * Determine if a string is empty. In order to qualify, value must
             * be either an object string or primitive string and have a length
             * of 0 or contain only whitespace characters.
             * @param {Object} value    Any value.
             * @return {Boolean}        Whether the value is an empty string.
             */
        ,   empty: function (value) 
            {
                return String.is(value) && value.isEmpty();
            }
        }
    );
